package com.itheima.stringbuilder;

public class Demo3StringBuilder {
    /*
    实现功能判断字符串是否是对称字符串
     */
    public static void main(String[] args) {
        String s = "1223321";
        StringBuilder sb = new StringBuilder(s);
        //使用StringBuilder类的reverse方法反转字符串,再用toString方法转为String类型
        String s1 = sb.reverse().toString();
        if(s.equals(s1)){
            System.out.println(true);
        }else{
            System.out.println(false);
        }
    }
}
